package com.oocl.jpa.service.impl;

import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.oocl.jpa.dao.CustomerDao;
import com.oocl.jpa.pojo.Customer;
import com.oocl.jpa.service.CustomerService;

/**
 * @description: 
 * @author  XIEMI2
 * @date Aug 9, 2017 5:48:59 PM
 * @version 1.0
 */
@Service(value="customerService")
public class CustomerServiceImpl implements CustomerService{

	@Resource(name="customerDao")
	private CustomerDao customerDao;
	
	@Override
	public Customer register(Customer customer) {
		customer.setId(UUID.randomUUID().toString());
		return customerDao.addCustomer(customer);
	}

	@Override
	public Customer login(String cname, String psd) {
		return customerDao.findCustomer(cname, psd);
	}

}


